package com.hxd.qzg.common.enums;

import com.hxd.qzg.common.ServiceException;

public enum MsgTypeEnum {
	USE(100, "使用柜子"), OPEN(500, "仅开柜"), CLOSE(1000, "关柜子"), QZ(1500, "取证"), SCAN(2000, "绑定信息");

	MsgTypeEnum(int code, String description) {
		this.code = code;
		this.description = description;
	}

	private int code;

	private String description;

	public int getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}

	public static String getDescription(int code) {

		for (MsgTypeEnum statusEnum : MsgTypeEnum.values()) {

			if (statusEnum.code == code) {

				return statusEnum.getDescription();
			}

		}
		throw new ServiceException("盒子当前状态不存在");
	}

}
